#ifndef GUICONTAINER_H_
#define GUICONTAINER_H_

#include "irrlicht.h"
#include <iostream>
#include <vector>
#include <exception>
#include <boost/shared_ptr.hpp>
#include "guiComponent.h"


using std::vector;
using boost::shared_ptr;


class guiContainer : public virtual guiComponent {
	protected:
		vector<shared_ptr<guiComponent> > m_components;
	public:
		guiContainer() { }
		virtual bool hasID(const s32& id);
		virtual void handleEvent(const s32& id, const SEvent& event);
		virtual bool addComponent(guiComponent* const widget) {
			try {
				m_components.push_back(shared_ptr<guiComponent>(widget));
				return true;
			}
			catch(std::exception& e) {
				std::cout<<"Standard exception:: "<<e.what()<<std::endl;
			}
			catch(...) {
				std::cout<<"Unknown error occurred, throwing."<<std::endl;
				throw;
			}
		}
		virtual ~guiContainer() { }
};

typedef guiContainer Menu;

#endif /*GUICONTAINER_H_*/
